import React from 'react';
import { connect, } from 'react-redux';
import Item from './item';

const TodoShow = (props) => {

  const { todoReducer } = props;

  return (
    <div>
      {
        todoReducer.todoList.map((item, index) => (
          <Item text={ item } index={ index } key={index} />
        ))
      }
    </div>
  );
};

const mapStateToProps = (state) => {
  return {
    ...state,
  };
};

export default connect(mapStateToProps)(TodoShow);
